<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8">
	<title>黔南民族师范学院综合教育学分认定系统</title>

	<link rel="stylesheet" href="/jquery-easyui-1.3.5/themes/icon.css" />
	<link rel="stylesheet" href="/jquery-easyui-1.3.5/themes/default/easyui.css"/>

	<script type="text/javascript" src="/jquery-easyui-1.3.5/jquery.min.js"></script>
	<script type="text/javascript" src="/jquery-easyui-1.3.5/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="/jquery-easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
    <style type="text/css">
    	form div{
    		margin:20px auto;
    		width:250px;
    		text-align:center
    	}
    	
    </style>
    <script type="text/javascript">
		$(function(){
			var dg = parent.$("iframe[title='用户管理']").get(0).contentWindow.$("#dg");
			var rows = dg.datagrid("getSelections");
			$('#cc').combobox({
				url:'/school/queryAll',
				valueField:'id',
				textField:'name',
				panelHeigth:'auto',
				panelWidth:140,
				width:160,
				editable:false,
				required:true,
				missingMessage:'请选择所属学院'
			});

			$("#ff").form('load',{
				id:rows[0].id,
				username:rows[0].username,
				truename:rows[0].truename,
				password:rows[0].password,
				status:rows[0].status,
				sid:rows[0].sid
			});
			$("input[name=truename]").validatebox({
				required:true,
				missingMessage:'请输入真实名'
			});
			$("input[name=password]").validatebox({
				required:true,
				missingMessage:'请输入密码'
			});

			$("#ff").form("disableValidation");

			$("#btn").click(function(){
				$("#ff").form("enableValidation");
				if($("#ff").form("validate")){
					$("#ff").form('submit',{
								url:'/user/updateUser',
								success:function(){
									parent.$("#win").window("close");
									parent.$("iframe[title='用户管理']").get(0).contentWindow.$("#dg").datagrid("reload");
								}
							}
					);
				}
			});
		});



	</script>
</head>

<body>
<form id="ff" method="post">
	<div>
		<label >用户名称:</label>
		<input type="text" name="username" readonly="readonly"/>
	</div>
	<div>
		<label >真实姓名:</label>
		<input type="text" name="truename" />
	</div>
	<div>
		<label >用户密码:</label>
		<input type="password" name="password" />
	</div>
	<div>
		<label >在岗状态:</label>
		<input type="radio" name="status" value="true" checked="checked"/>在岗
		<input type="radio" name="status" value="false"/>不在岗
	</div>
	<div>
		<label>所属学院:</label>
		<input id="cc" name="sid"></input>
	</div>
	<div>
		<a style="text-align:center;" id="btn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-edit'">更新用户</a>
		<input type="hidden" name="id" />
	</div>
</form>
</body>
</html>